package com.dragon.app.marvel.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import com.dragon.rabbitmq.CoreServiceProduct;
import com.marvels.common.utils.MarvelsLogUtil;

@Component
public class AsyncCallApi {
	@Autowired
	private CoreServiceProduct coreServiceProduct;
	
	@Async
	public void sendLoanApplyMessage(String loanId){
		try {
			// 3秒后才发送到新核心
			Thread.sleep(3000);
			coreServiceProduct.sendLoanApplyMessage(loanId);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("=======sendLoanApplyMessage=======" + loanId, e);
		}
	}
}
